From 324ad7a4a8010ae406eccb0d42581db35418c9b4 Mon Sep 17 00:00:00 2001 From: Ewan Mellor Date: Sat, 16 Dec 2006 12:52:18 +0000 Subject: [PATCH] An error occurs if the first detach was successful and the 2nd one is not (of course). Return if the 1st detach is successful, try the 2nd one if it was not successful. Throw an error if the 2nd one fails. This should also fix problems I am currently seeing in the xm-test suite. Signed-off-by: Stefan Berger --- tools/python/xen/xm/main.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/python/xen/xm/main.py b/tools/python/xen/xm/main.py index a503835cf5..42e6f74899 100644 --- a/tools/python/xen/xm/main.py +++ b/tools/python/xen/xm/main.py @@ -1556,7 +1556,11 @@ def detach(args, command, deviceClass): def xm_block_detach(args): - detach(args, 'block-detach', 'vbd') + try: + detach(args, 'block-detach', 'vbd') + return + except: + pass detach(args, 'block-detach', 'tap') -- 2.30.2